package cn.yy.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Providetotalrbill entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "providetotalrbill", catalog = "phoneerp")
public class Providetotalrbill implements java.io.Serializable {

	// Fields

	private Integer providerBillId;
	private Paybill paybill;
	private Provider provider;
	private Double proOriginCount;
	private Set<Provider> providers = new HashSet<Provider>(0);

	// Constructors

	/** default constructor */
	public Providetotalrbill() {
	}

	/** minimal constructor */
	public Providetotalrbill(Paybill paybill, Provider provider,
			Double proOriginCount) {
		this.paybill = paybill;
		this.provider = provider;
		this.proOriginCount = proOriginCount;
	}

	/** full constructor */
	public Providetotalrbill(Paybill paybill, Provider provider,
			Double proOriginCount, Set<Provider> providers) {
		this.paybill = paybill;
		this.provider = provider;
		this.proOriginCount = proOriginCount;
		this.providers = providers;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "providerBillID", unique = true, nullable = false)
	public Integer getProviderBillId() {
		return this.providerBillId;
	}

	public void setProviderBillId(Integer providerBillId) {
		this.providerBillId = providerBillId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "payBillId", nullable = false)
	public Paybill getPaybill() {
		return this.paybill;
	}

	public void setPaybill(Paybill paybill) {
		this.paybill = paybill;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "providerID", nullable = false)
	public Provider getProvider() {
		return this.provider;
	}

	public void setProvider(Provider provider) {
		this.provider = provider;
	}

	@Column(name = "proOriginCount", nullable = false, precision = 22, scale = 0)
	public Double getProOriginCount() {
		return this.proOriginCount;
	}

	public void setProOriginCount(Double proOriginCount) {
		this.proOriginCount = proOriginCount;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "providetotalrbill")
	public Set<Provider> getProviders() {
		return this.providers;
	}

	public void setProviders(Set<Provider> providers) {
		this.providers = providers;
	}

}